Release 10.1A: OpenEdge Development:
Progress 4GL Reference
OUTPUT THROUGH statement
(NT, UNIX only)Identifies a new output destination as the input to a process that Progress starts.
Syntax
STREAMstreamThe name of a stream. If you do not name a stream, Progress uses the unnamed stream. See the DEFINE STREAM statement reference entry in this book and the chapter on alternate I/O sources in OpenEdge Development: Programming Interfaces for more information on streams.
program-nameThe name of the program to which you are supplying data from a procedure. This can be a standard command or your own program.
VALUE (expression)An expression whose value is the name of a UNIX program to which you are supplying data from a procedure.
An expression is also the argument that you want to pass to the UNIX program. OUTPUT THROUGH passes the value of
expressionas a character string.argumentAn argument you want to pass to the UNIX program. The OUTPUT THROUGH statement passes this argument as a character string.
If the argument is the literal value paged, page-size, echo, no-echo, or unbuffered, you must enclose it in quotes to prevent Progress from using that argument as one of the PAGED, PAGE-SIZE, ECHO, NO-ECHO, or UNBUFFERED options for the OUTPUT THROUGH statement.
ECHOSends all input data read from a file to the UNIX program. Progress echoes data by default.
NO-ECHOSuppresses the echoing of input data to the UNIX program.
MAPprotermcap-entry| NO-MAPThe
protermcap-entryis an entry from the PROTERMCAP file. Use MAP to send output to a device that requires different character mappings than those in effect for the current output stream. Typically,protermcap-entryis a slash-separated combination of a standard device entry and one or more language-specific add-on entries (MAP laserwriter/french or MAP hp2/spanish/italian, for example). Progress uses the PROTERMCAP entries to build a translation table for the stream. Use NO-MAP to make Progress bypass character translation altogether. See OpenEdge Deployment: Managing 4GL Applications for more information on PROTERMCAP. See OpenEdge Development: Internationalizing Applications for more information on national language support.PAGEDFormats the output into pages.
PAGE-SIZE {constant| VALUE (expression) }Specifies the number of lines per page. The
expressionis a constant, field name, variable name, or expression whose value is an integer. The default number of lines per page is 56. If you use the TERMINAL option to direct output to the terminal, the default number of lines per page is the number of lines of TEXT widgets that fit on the screen. If you specify a non-zero value for PAGE-SIZE, then the PAGED option is assumed. If you specify PAGE-SIZE 0, the output is not paged.UNBUFFEREDWrites one character at a time to a normally buffered data source, such as a file. Use the UNBUFFERED option only when you can intermingle your UNIX output (with the Progress UNIX statement) and your Progress output (with the OUTPUT THROUGH statement). That is, the OUTPUT THROUGH statement manages the buffering of output between the Progress procedure the UNIX program that it invokes, but it does not handle the buffering of output to any other programs that the Progress procedure might also invoke.
CONVERTAllows you to modify the character conversions occurring between the UNIX program and Progress. By default, the OUTPUT TO statement converts characters from the code page specified with the Internal Code Page (-cpinternal) parameter to the code page specified with the Stream Code Page (-cpstream) parameter. If you specify SOURCE
source-codepagealone, the conversion acceptssource-codepageas the code page name used in Progress memory (instead of -cpinternal). If you specify TARGETtarget-codepage, the conversion acceptstarget-codepageas the code page of the UNIX program (instead of -cpstream). If you specify both SOURCEsource-codepageand TARGETtarget-codepage, it converts characters from thesource-codepagetotarget-codepage(instead of -cpinternal to -cpstream).TARGETtarget-codepageSpecifies the target code page of the character conversion (replacing -cpstream). The name that you specify must be a valid code page name available in the
DLC/convmap.cpfile (a binary file that contains all of the tables that Progress uses for character management).SOURCEtarget-codepageSpecifies the source code page of the character conversion (replacing -cpinternal). The name that you specify must be a valid code page name available in the
DLC/convmap.cpfile (a binary file that contains all of the tables that Progress uses for character management).NO-CONVERTSpecifies that no character conversions occur between the external file and Progress. By default, the OUTPUT THROUGH statement converts characters from the -cpinternal code page to the -cpstream code page.
ExamplesIn this example, the customer names are displayed. This output is sent as input to the UNIX
wc(word count) command. The output ofwcis directed to the file wcdata using the standard UNIX redirection symbol (>). Finally, the results are displayed as three integers that represent the number of lines, words, and characters that were in the data sent to wc.
The
r-othru2.pprocedure uses the UNIXcryptprogram, which accepts lines of data, applies an algorithm based on an encryption key and writes the result to the UNIX standard output stream, that can be directed to a file. The output from the procedure is directed tocrypt, which encrypts the customer names based on the password, mypass. The results of the encryption are stored in the ecust file. Then, Progress decrypts and displays this file.
Notes
- When you use the OUTPUT CLOSE statement to close an output destination used by an OUTPUT THROUGH statement, Progress closes the pipe, waits one second, and then continues.
- For any character conversions to occur, all of the necessary conversion tables must appear in
convmap.cp(a binary file that contains all of the tables that Progress uses for character management).- If you specify a value of “undefined” for either
source-codepageortarget-codepage, no character conversion is performed.- For more information on output destinations, see OpenEdge Development: Programming Interfaces .
See also
DEFINE STREAM statement, OUTPUT CLOSE statement, OUTPUT TO statement
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |